import type { ConsultInfo } from "@/types/consult"
import { defineStore } from "pinia"
import { ref } from "vue"

export const useConsultStore = defineStore('consult', () => {

  // 1. 定义初始数据(用于后边的重置操作)
  const initalValue = {
    illnessDesc: '',
    illnessTime: 1,
    consultFlag: 0,
    pictures: [] 
  }

  // 2. 定义全局数据
  const illnessInfo = ref<ConsultInfo>({...initalValue})
 
  return { illnessInfo }
}, {
  // @ts-ignore
  unistorage: true
})